package com.zhanghe.handler;

import io.netty.handler.codec.http.FullHttpRequest;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

public class HttpHanlder {
	
	private Object instance;
	private Method method;
	
	public HttpHanlder( Object instance ,Method method ){
		super();
		this.instance = instance;
		this.method = method;
	}
	
	public Object excute(FullHttpRequest fullHttpRequest) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException{
		method.setAccessible(true);
		return method.invoke(this.instance, fullHttpRequest);
	}
}
